package cn.iocoder.yudao.module.crossborder.platform.controller.admin.platformwebhook.vo;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import javax.validation.constraints.*;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;

@Schema(description = "管理后台 - 跨境电商平台Webhook配置新增/修改 Request VO")
@Data
public class PlatformWebhookSaveReqVO {

    @Schema(description = "Webhook编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "32522")
    private Long id;

    @Schema(description = "平台编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "21043")
    @NotNull(message = "平台编号不能为空")
    private Long platformId;

    @Schema(description = "店铺编号", example = "560")
    private Long storeId;

    @Schema(description = "Webhook类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
    @NotEmpty(message = "Webhook类型不能为空")
    private String webhookType;

    @Schema(description = "事件类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
    @NotEmpty(message = "事件类型不能为空")
    private String eventType;

    @Schema(description = "Webhook URL", requiredMode = Schema.RequiredMode.REQUIRED, example = "https://www.iocoder.cn")
    @NotEmpty(message = "Webhook URL不能为空")
    private String webhookUrl;

    @Schema(description = "密钥")
    private String secretKey;

    @Schema(description = "验证令牌")
    private String verificationToken;

    @Schema(description = "请求头配置JSON")
    private String headersConfig;

    @Schema(description = "负载格式（json/xml/form）", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotEmpty(message = "负载格式（json/xml/form）不能为空")
    private String payloadFormat;

    @Schema(description = "重试策略JSON")
    private String retryPolicy;

    @Schema(description = "过滤配置JSON")
    private String filterConfig;

    @Schema(description = "状态（0正常 1停用）", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
    @NotNull(message = "状态（0正常 1停用）不能为空")
    private Integer status;

    @Schema(description = "是否启用", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "是否启用不能为空")
    private Boolean enabled;

    @Schema(description = "最后触发时间")
    private LocalDateTime lastTriggerTime;

    @Schema(description = "触发次数", requiredMode = Schema.RequiredMode.REQUIRED, example = "20036")
    @NotNull(message = "触发次数不能为空")
    private Integer triggerCount;

    @Schema(description = "成功次数", requiredMode = Schema.RequiredMode.REQUIRED, example = "13192")
    @NotNull(message = "成功次数不能为空")
    private Integer successCount;

    @Schema(description = "失败次数", requiredMode = Schema.RequiredMode.REQUIRED, example = "10301")
    @NotNull(message = "失败次数不能为空")
    private Integer failedCount;

    @Schema(description = "备注", example = "你猜")
    private String remark;

}